//文件的写操作3
import java.io.*;
public class Demo14 {
    public static void main(String[] args) throws IOException {
        try(OutputStream out = new FileOutputStream("hello5.txt")){
            byte[] b = "Hello,world!".getBytes();
            out.write(b, 0, 5); //写入数组b的前5个字节
            out.flush(); //千万不要忘记flush
        }
    }
}
